package com.ruoyi.patrol.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.patrol.vo.PtEquipmentVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.patrol.mapper.PtEquipmentMapper;
import com.ruoyi.patrol.domain.PtEquipment;
import com.ruoyi.patrol.service.IPtEquipmentService;

/**
 * 设备信息Service业务层处理
 *
 * @author linan
 * @date 2024-02-03
 */
@Service
public class PtEquipmentServiceImpl implements IPtEquipmentService
{
    @Autowired
    private PtEquipmentMapper ptEquipmentMapper;

    /**
     * 查询设备信息
     *
     * @param id 设备信息主键
     * @return 设备信息
     */
    @Override
    public PtEquipment selectPtEquipmentById(Long id)
    {
        return ptEquipmentMapper.selectPtEquipmentById(id);
    }

    /**
     * 查询设备信息列表
     *
     * @param ptEquipment 设备信息
     * @return 设备信息
     */
    @Override
    public List<PtEquipmentVO> selectPtEquipmentList(PtEquipment ptEquipment)
    {
        return ptEquipmentMapper.selectPtEquipmentList(ptEquipment);
    }

    /**
     * 新增设备信息
     *
     * @param ptEquipment 设备信息
     * @return 结果
     */
    @Override
    public int insertPtEquipment(PtEquipment ptEquipment)
    {
        ptEquipment.setCreateTime(DateUtils.getNowDate());
        return ptEquipmentMapper.insertPtEquipment(ptEquipment);
    }

    /**
     * 修改设备信息
     *
     * @param ptEquipment 设备信息
     * @return 结果
     */
    @Override
    public int updatePtEquipment(PtEquipment ptEquipment)
    {
        ptEquipment.setUpdateTime(DateUtils.getNowDate());
        return ptEquipmentMapper.updatePtEquipment(ptEquipment);
    }

    /**
     * 批量删除设备信息
     *
     * @param ids 需要删除的设备信息主键
     * @return 结果
     */
    @Override
    public int deletePtEquipmentByIds(Long[] ids)
    {
        return ptEquipmentMapper.deletePtEquipmentByIds(ids);
    }

    /**
     * 删除设备信息信息
     *
     * @param id 设备信息主键
     * @return 结果
     */
    @Override
    public int deletePtEquipmentById(Long id)
    {
        return ptEquipmentMapper.deletePtEquipmentById(id);
    }
}
